package com.hernie.piggymall.cart.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author HuangJp
 * @Date 2022/4/20
 * @Description 拦截器配置
 */
@Configuration
public class PiggymallWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartInterceptor())  // 注册拦截器
                .addPathPatterns("/**");    // 设置拦截范围
    }
}
